<include file="public@header"/>
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">

		<!-- 	<li><a href="{:url('Customer/index')}">客户</a></li> -->
			<li class="active"><a href="{:url('Customer/addCustomer')}">添加</a></li>
			<!-- 	<li class="active><a href="{:url('station/index')}">园区添加</a></li> -->
			<!-- <li ><a href="javascript:;">编辑分类</a></li> -->
		</ul>

		<form method="post" class="form-horizontal  margin-top-20" action="addCustomers">

			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">客户名称<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="customer_name" value="" required="true">
				</div>
			</div>
		
			<!-- <div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">客户性质<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="customer_type" value="" required="true">
				</div>
			</div> -->
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">客户性质</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="customer_type" id="parent_id">
						<option value="">==请选择==</option>

						<option value="1">项目客户</option>
						<option value="2">合作客户</option>


					</select>
				</div>
			</div>
			<div class="form-group"  style="display: none">
				<!-- <label for="input-name" class="col-sm-2 control-label">业务员<span class="form-required">*</span></label> -->
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="hidden" name="salesman" value="" required="true">
				</div>
			</div>
			
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">客户职位<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="position" value="" required="true">
				</div>
			</div>

			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">来源<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<!-- <input class="form-control" type="text" name="other_link" value="" > -->
					<select class="form-control" name="other_link" id="parent_id">
						<option value="">==请选择==</option>
						<option value="1">电话</option>
						<option value="2">来访</option>
						<option value="3">熟人介绍</option>
						<option value="4">其他</option>
					

					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">客户电话<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="mobile" value="" required="true">
				</div>
			</div>

		
<!-- 			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">领域<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="field" value="" >
				</div>
			</div>
 -->
			<div class="form-group">
			 	<label for="input-name" class="col-sm-2 control-label">领域</label>
			 	<div class="col-md-6 col-sm-10">
			 		<select class="form-control" name="field" id="parent_id">
			 			<option value="">==请选择==</option>
			 			<volist name="cate_list" id="vo">
			 				<option value="{$vo.id}">{$vo.name}</option>
			 			</volist>


			 		</select>
			 	</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">跟进情况<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<!-- <input class="form-control" type="text" name="follow_state" value="" required="true"> -->
					  <textarea class="form-control" name="follow_state" style="height: 50px;"
                                      placeholder="请填跟进情况"></textarea>
				</div>
			</div>
		<!-- 	<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">跟进情况<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="follow_state" value="" required="true">
				</div>
			</div> -->
			<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">阶段 <span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="stage" id="parent_id" required="true">
						<option value="">==请选择==</option>
						<volist name="stages" id="vo">
						<option value="{$vo.id}">{$vo.name}</option>
						</volist>
						
					<!-- 	<option value="0">未跟进 </option>
						<option value="1"> 初步洽谈</option>
						<option value="2"> 需求确认</option>
						<option value="3"> 意向确认</option>
						<option value="4"> 入孵签订</option>
						<option value="5"> 客户流失</option> -->
					</select>
				</div>
			</div>
			<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">跟进阶段 <span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="follow_stage" id="parent_id" required="true">
						<option value="">==请选择==</option>
						<volist name="gen_stage" id="vo">
						<option value="{$vo.id}">{$vo.name}</option>
						</volist>
						
					<!-- 	<option value="0">未跟进 </option>
						<option value="1"> 初步洽谈</option>
						<option value="2"> 需求确认</option>
						<option value="3"> 意向确认</option>
						<option value="4"> 入孵签订</option>
						<option value="5"> 客户流失</option> -->
					</select>
				</div>
			</div>

		<!-- 	<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">对接人<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="linkman" value="" required="true">
				</div>
			</div> -->
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">业务员<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<!-- <input class="form-control" type="text" name="other_link" value="" > -->
					<select class="form-control" name="salesman" id="parent_id">
						<option value="">==选择业务员==</option>\
						<volist name="salesman" id="vo">
								<option value="{$vo.id}">{$vo.user_login}</option>
						</volist>
					<!-- 	<option value="1">电话</option>
						<option value="2">来访</option>
						<option value="3">熟人介绍</option>
						<option value="4">其他</option> -->
					

					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">业务员电话<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="salesmobile" value="" required="true">
				</div>
			</div>
			

		</div>
			<!-- <div class="form-group">
				<label for="input-remark" class="col-sm-2 control-label">备注</label>
				<div class="col-md-6 col-sm-10">
					<label class="radio-inline js-icheck"><input type="radio" name="status" value="1" checked>显示</label>
					<label class="radio-inline js-icheck"><input type="radio" name="status" value="0" <if condition="1">checked</if>>隐藏</label>
				</div>
			</div> -->
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<!-- <input type="hidden" name="id" value="1"> -->
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
					<a class="btn btn-default" href="{:url('Order/addOrder')}">{:lang('BACK')}</a>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script type="text/javascript">
		$(function() {
			$("select[name=salesselect]").change(function(){
				name=$(this).find("option:selected").text();
				$("input[name=salesman]").val(name);
				//$("select[name=salesselect]").val("");

			})	
			　$("input[name=salesman]").mouseout(function(){
				name=$(this).val();
				$.post("{:url('Customer/check_sales')}",{name:name},function(data,status){
						if(data==0){
							// if(confirm("该业务员不存在是否需要添加？")){
							// 	$.post("{:url('Customer/check_sales')}",{name:name,sure:1},function(data,status){

							// 	})
							// }	
						}
				})
			});
		});
	</script>
</body>
</html>